﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Domain
{
    /// <summary>
    /// Гонка
    /// </summary>
    public class Race: INotifyPropertyChanged
    {
        public String Name { get; set; }

        public ObservableCollection<Run> Runs { get; private set; }

        public ObservableCollection<Category> Categories { get; private set; }

        public ObservableCollection<Racer> Racers { get; private set; }

        public Race()
        {
            Runs = new ObservableCollection<Run>();
            Categories = new ObservableCollection<Category>();
            Racers = new ObservableCollection<Racer>();
        }

        #region Implementation of INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        public void InvokePropertyChanged(PropertyChangedEventArgs e)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, e);
        }

        #endregion
    }
}
